package com.idelan.commonMessage.constant;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 自定义注解
 * User gyli
 * date 2018/6/5
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Constraint(validatedBy = NameValidatorClass.class)
public @interface NameValidator {
    String value();
    String message() default "用户名由字母数字下划线组成且字母开头3-12个字符";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
